package cn.coisini.api.admin;

import cn.coisini.model.common.dtos.Result;
import cn.coisini.model.common.enums.ResultEnum;
import cn.coisini.model.pojo.Tag;
import cn.coisini.model.vo.QueryVo;
import cn.coisini.model.vo.TagVo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author xiangshaw
 * Description: 标签接口API
 */
@io.swagger.v3.oas.annotations.tags.Tag(name = "标签接口API", description = "新增、查询、修改、删除")
@RequestMapping("/api/v1/tag")
@Validated
public interface TagControllerApi {

    @Operation(summary = "新增标签接口")
    @PostMapping("/add")
    Result<ResultEnum> addTag(
            @RequestBody
            @Validated({TagVo.Add.class})
            TagVo tagVo);

    @Operation(summary = "查询标签列表接口")
    @GetMapping("/list")
    Result<Object> getTagList(QueryVo queryVo);

    @Operation(summary = "发布文章获取标签列表")
    @GetMapping("/allTag")
    Result<List<Tag>>  getTagList();

    @Operation(summary = "修改标签接口")
    @PutMapping("/update")
    Result<ResultEnum> updateTag(
            @RequestBody
            @Validated({TagVo.Update.class})
            TagVo tagVo);

    @Operation(summary = "删除标签接口")
    @DeleteMapping("/delete")
    Result<ResultEnum> deleteTag(TagVo tagVo);

    @Operation(summary = "批量删除标签接口")
    @DeleteMapping("/deleteByIds")
    Result<ResultEnum> deleteTagByIds(@RequestBody TagVo tagVo);
}
